'''
给定两个字符串 s 和 t ，编写一个函数来判断 t 是否是 s 的
示例 1:
输入: s = "anagram", t = "nagaram"
输出: true
示例 2:
输入: s = "rat", t = "car"
输出: false
'''
s = "anagram"
t = "nagaram"
print(sorted(s)==sorted(t))

class Solution(object):
    def isAnagram(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: bool
        """
        if len(s) != len(t):
            return False
        return sorted(s) == sorted(t)

